# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor: Jan de Groot <jgc@archlinux.org>
# Contributor: Kritoke <kritoke@nospam.gmail.com>

pkgname=gnome-nettool
pkgver=42.0
pkgrel=2
pkgdesc="Graphical interface for various networking tools"
url="https://gitlab.gnome.org/GNOME/gnome-nettool"
arch=(x86_64)
license=(GPL)
depends=(
  gtk3
  iputils
  libgtop
  whois
)
makedepends=(
  bind
  git
  meson
  net-tools
  nmap
  yelp-tools
)
optdepends=(
  'bind: DNS lookup'
  'net-tools: Network statistics'
  'nmap: Port scanning'
)
_commit=5748c0fa632c9caad9e46377ca1aa330dec4b757  # tags/gnome-nettool-42-0^0
source=(
  "git+https://gitlab.gnome.org/GNOME/gnome-nettool.git#commit=$_commit"
  fix-build.diff
)
b2sums=('SKIP'
        '1da17fa0249252842a4cc4c68d00f67b5f085642ae10e6db68708df3cf1fa4b88c9039b2deff2e70ffadf8474da85a33b50bf1a1b639bf12dda05e696f239e72')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/^gnome-nettool-//;s/-/./;s/[^-]*-g/r&/;s/-/+/g'
}

prepare() {
  cd $pkgname

  # Fix build with recent Meson
  git apply -3 ../fix-build.diff
}

build() {
  arch-meson $pkgname build
  meson compile -C build
}

check() {
  meson test -C build --print-errorlogs
}

package() {
  meson install -C build --destdir "$pkgdir"
}

# vim set:sw=2 sts=-1 et:
